package com.yf1706.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yf1706.bean.CheckFrequency;
import com.yf1706.dao.jpa.ICheckFrequencyJDAO;
import com.yf1706.dao.mybatis.ICheckFrequencyMDAO;


@Service
@Transactional(rollbackFor=Exception.class)
public class CheckFrequencyService {
	@Autowired ICheckFrequencyMDAO cfMDao;
	@Autowired ICheckFrequencyJDAO cfJDao;
	/**
	 * 查询所有的班次信息
	 * @return
	 */
	public List<CheckFrequency> getfrequencyList(){
		return cfMDao.queryCheckFrequency();
	}
	//模糊查询假种信息
	public List<CheckFrequency> getSerchheckFrequencyList(String frequencyName){
		return cfMDao.querySerchCheckFrequency(frequencyName);
	}
	//存储新增班次信息
	public void addCheckFrequency(CheckFrequency frequency) {
		frequency.setMakeTime(new Date());
		frequency.setState("是");
		cfJDao.save(frequency);
	}
	//修改班次信息
	public void updatecheckFrequency(CheckFrequency frequency) {
		frequency.setUpdateTime(new Date());
		frequency.setState("是");
		cfJDao.save(frequency);
	}

}
